﻿@model Weapsy.Reporting.Pages.ModuleModel

<div class="panel-heading">
    <div class="panel-title">
        <div class="glyphicon glyphicon-option-vertical handle" aria-hidden="true"></div>
        <div class="pull-right">
            <ul class="nav module-actions module-data" data-module-id="@Model.Id" data-page-module-id="@Model.PageModuleId" data-module-edit-url="@Model.ModuleType.EditUrl">
                <li class="dropdown">
                    <a href="#" data-toggle="dropdown" class="glyphicon glyphicon-collapse-down" title="Module Actions"></a>
                    <ul class="dropdown-menu">
                        @if (!string.IsNullOrWhiteSpace(Model.ModuleType.EditUrl))
                        {
                            <li>
                                @if (Model.ModuleType.EditType == Weapsy.Domain.ModuleTypes.EditType.Modal)
                                {
                                    <a href="#" class="module-edit" data-toggle="modal" data-target="#modal-admin" title="Edit">
                                        <i class="glyphicon glyphicon-edit"></i>
                                        <span>Edit</span>
                                    </a>
                                }
                                else if (Model.ModuleType.EditType == Weapsy.Domain.ModuleTypes.EditType.Page)
                                {
                                    <a href="@Model.ModuleType.EditUrl" class="module-edit" title="Edit">
                                        <i class="glyphicon glyphicon-edit"></i>
                                        <span>Edit</span>
                                    </a>
                                }
                            </li>
                        }
                        <li>
                            <a href="#" class="module-settings" data-toggle="modal" data-target="#modal-admin" title="Settings">
                                <i class="glyphicon glyphicon-cog"></i>
                                <span>Settings</span>
                            </a>
                        </li>
                        <li>
                            <a href="#" class="module-remove" title="Remove" data-toggle="modal" data-target="#confirm-delete-module">
                                <i class="glyphicon glyphicon-remove"></i>
                                <span>Remove</span>
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
</div>
